<template>
<div class="iframe-container">
  <iframe :src="currentUrl"
          frameborder="0"
          width="100%"
          height="800px"
          scrolling="auto"
          style="background-color: #fff;"></iframe>
</div>
</template>

<script>
import { iframeUrl } from '@/config/leave.config'
export default {
  name: 'IframeBox',
  data () {
    return {
      currentUrl: ''
    }
  },
  created() {

  },
  watch: {
    '$route': {
      immediate: true,
      handler: function (nVal, oVal) {
        if (nVal.name === 'model-list') {
          this.currentUrl = iframeUrl.modelList
        } else if (nVal.name === 'process-model-list') {
          this.currentUrl = iframeUrl.processModelList
        }
      }
    }
  }
}
</script>

<style scoped>

</style>